package com.study.bigdata.spark.core.rdd.operator.transform

import org.apache.spark.{SparkConf, SparkContext}

object Scala09_RDD_Operator_Transform{
  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setMaster("local[*]").setAppName("RDD")
    conf.set("spark.local.dir","D:\\hadoopbook\\spark\\test")
    val sc = new SparkContext(conf)

    val rdd = sc.makeRDD(List(2,2,4,3,1,1,5))
    // TODO 算子 - 转换 - distinct
    val rdd1 = rdd.distinct()
    rdd1.collect().foreach(println)
    /*
    1
    2
    3
    4
    5
     */
    sc.stop()
  }

}
